﻿using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using OfficeOpenXml.Table;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ZhonTai.Industry.Services.WorkStationRecord.Dto.Output
{
    [ExcelExporter(Name = "产品过站记录列表", TableStyle = TableStyles.Light9, AutoFitAllColumn = true, AutoFitMaxRows = 5000)]
    public class WorkStationRecordExport
    {
        /// <summary>
        /// Id
        /// </summary>
        [ExporterHeader(DisplayName = "过站序号", Format = "", ColumnIndex = 1)]
        public long Id { get; set; }

        /// <summary>
        /// 产品编号
        /// </summary>
        [ExporterHeader(DisplayName = "产品编号", Format = "0", ColumnIndex = 2)]
        public string? ProductCode { get; set; }

        /// <summary>
        /// 工站Id
        /// </summary>
        [ExporterHeader(IsIgnore = true)]
        public long StationId { get; set; }

        /// <summary>
        /// 工站代号
        /// </summary>
        [ExporterHeader(DisplayName = "工站代号", Format = "0", ColumnIndex = 3)]
        public string StationCode { get; set; }

        /// <summary>
        /// 工站名称
        /// </summary>
        [ExporterHeader(DisplayName = "工站名称", Format = "0", ColumnIndex = 4)]
        public string StationName { get; set; }

        /// <summary>
        /// 产线代号
        /// </summary>
        [ExporterHeader(DisplayName = "产线代号", Format = "0", ColumnIndex = 5)]
        public string LineCode { get; set; }

        /// <summary>
        /// 产线名称
        /// </summary>
        [ExporterHeader(DisplayName = "产线名称", Format = "0", ColumnIndex = 6)]
        public string LineName { get; set; }

        /// <summary>
        /// 订单Id
        /// </summary>
        /// <remarks>订单Id</remarks>
        [ExporterHeader(DisplayName = "订单Id", Format = "0", ColumnIndex = 7)]
        public long? OrderId { get; set; }

        /// <summary>
        /// 产品类型代号
        /// </summary>
        [ExporterHeader(DisplayName = "产品类型代号", Format = "0", ColumnIndex = 8)]
        public string? ProductModelCode { get; set; }

        /// <summary>
        /// 产品类型名称
        /// </summary>
        [ExporterHeader(DisplayName = "工单序号", Format = "0", ColumnIndex = 9)]
        public string? ProductModelName { get; set; }

        /// <summary>
        /// 加工开始时间
        /// </summary>
        /// <remarks>加工开始时间</remarks>
        [ExporterHeader(DisplayName = "加工开始时间", Format = "yyyy-MM-dd HH:mm:ss", ColumnIndex = 10)]
        public DateTime StartTime { get; set; }

        /// <summary>
        /// 加工结束时间
        /// </summary>
        /// <remarks>加工结束时间</remarks>
        [ExporterHeader(DisplayName = "加工结束时间", Format = "yyyy-MM-dd HH:mm:ss", ColumnIndex = 11)]
        public DateTime EndTime { get; set; }

        /// <summary>
        /// 循环时间
        /// </summary>
        /// <remarks>循环时间</remarks>
        [ExporterHeader(DisplayName = "循环时间", Format = "0", ColumnIndex = 12)]
        public double CycleTime { get; set; }

        /// <summary>
        /// 加工结果
        /// </summary>
        /// <remarks>加工结果</remarks>
        [ExporterHeader(DisplayName = "加工结果", Format = "0", ColumnIndex = 13)]
        public string? Result { get; set; }

        /// <summary>
        /// 载体
        /// </summary>
        /// <remarks>载体</remarks>
        [ExporterHeader(DisplayName = "托盘号", Format = "0", ColumnIndex = 14)]
        public string? Slot { get; set; }

        /// <summary>
        /// 缺陷代号
        /// </summary>
        /// <remarks>缺陷代号</remarks>
        [ExporterHeader(DisplayName = "缺陷代号", Format = "0", ColumnIndex = 15)]
        public string? DefectCode { get; set; }

        /// <summary>
        /// 上传标识
        /// </summary>
        /// <remarks>上传标识</remarks>
        [ExporterHeader(DisplayName = "上传标识", Format = "0", ColumnIndex = 16)]
        public bool Upload { get; set; }

        /// <summary>
        /// 记录时间
        /// </summary>
        /// <remarks>记录时间</remarks>
        [ExporterHeader(DisplayName = "记录时间", Format = "yyyy-MM-dd HH:mm:ss", ColumnIndex = 16)]
        public DateTime? CreatedTime { get; set; }
    }
}